<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>async</title>
</head>
<body>
    <script>
        //声明 async 函数
        async function main(){
            console.log('async Function');
            //1. 返回非 Promise 对象数据
            // return 'GoGoGo';
            //2. 返回 Promise 情况
            // return new Promise((resolve, reject) => {
            //     // resolve('Success');
            //     reject('error');
            // });
            //3. 抛出错误情况
            // throw new Error('出问题啦!!');
        }

        // let result = main();
        main().then(value => {
            console.log(value);// ??
        });

    </script>
</body>
</html>